﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace _11._4
{
    
    internal class Program
    {
        static void Main(string[] args)
        {
            Animals animals = new Animals();
            animals.Add("cow1", new Cow("cow1"));

            animals.Add("chicken1", new Chicken("chicken1"));

            animals["chicken1"].Feed();
            ((Cow)animals["cow1"]).Milk();

            //foreach (DictionaryEntry item in animals)
            //{
            //    Console.WriteLine(item.Key);
            //    Console.WriteLine(item.Value.ToString());


            //}

            foreach (Animal myan in animals)
            {
                Console.WriteLine(myan.Name + myan.ToString());
            }
            Console.ReadLine();
        }
    }
}
